Problems with tag O(nlogn * logr)